#include "logger.h"
#include <iostream>

struct LoggerImpl {
	int level_;
};

void Logger::error(const std::string& message, const int& logging_level) const
{
	if( logging_level >= level() )
		std::cerr << "ERROR:  " << message << std::endl;
}

void Logger::warning(const std::string& message, const int& logging_level) const
{
	if( logging_level >= level() )
		std::clog << "WARNING:  " << message << std::endl;
}

void Logger::message(const std::string& message, const int& logging_level) const
{
	if( logging_level >= level() )
		std::cout << "INFO:  " << message << '\n';
}

int Logger::level() const
{
	return pimpl_->level_;
}

void Logger::level(const int& logging_level)
{
	pimpl_->level_ = logging_level;
}
